#region Microsoft Public License
/*
 * (c) Copyright Chenjun Wu. http://utablesdk.codeplex.com
 * 
 * This source is subject to the Microsoft Public License (Ms-PL).
 * Please see http://go.microsoft.com/fwlink/?LinkID=131993 for details.
 * All other rights reserved.
 */
#endregion

﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Windows;
using System.Windows.Controls;
using UTable.Input;
using UTable.Input.MultiTouch;
using UTable.Objects;
using UTable.Objects.Controls;

namespace UTable.Tests
{
    /// <summary>
    /// Interaction logic for SaveDialogTest.xaml
    /// </summary>
    public partial class SaveDialogTest : UObject
    {
        public SaveDialogTest()
        {
            InitializeComponent();
        }

        private void UButton_Click(object sender, RoutedEventArgs e)
        {
            //IObject saveDialog = UTableHelper.CreateObject(typeof(USaveFileDialog), this);
            //saveDialog.SendMessage("ink.isf");
            //saveDialog.Closed += new EventHandler(saveDialg_Closed);

            USaveFileDialogModel model = new USaveFileDialogModel();
            model.SaveFileName = "ink.isf";
            UTableHelper.ShowModalObject(typeof(USaveFileDialog), model);
            Console.WriteLine("Result: " + model.SaveFileDirectory);
        }

        void saveDialg_Closed(object sender, EventArgs e)
        {
            IObject obj = sender as IObject;
            Console.WriteLine(obj);
            Console.WriteLine("Query Result: " + obj.QueryData("SaveFilePath"));
        }
    }
}
